package org.cklxh.waptime;

import org.waptime.R;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ProgressBar;
import android.widget.TextView;

public class RefreshOnClickListener implements OnClickListener {

	@Override
	public void onClick(View view) {
		
		WaptimeActivity waptimeActivity=WaptimeActivity.getActivityObject();
		
		ProgressBar refresh_pb=(ProgressBar)waptimeActivity.findViewById(R.id.refresh_pb);
		refresh_pb.setVisibility(View.VISIBLE);//显示进度条
		
		TextView internet_default_time_TV=(TextView)waptimeActivity.findViewById(R.id.internet_default_time_TV);
		internet_default_time_TV.setText(waptimeActivity.getResources().getString(R.string.refresh_tv));
		
		//开辟另外一个线程去访问网络，避免卡顿的情况。
		RefreshTimeThread refreshTimeThread=new RefreshTimeThread();
		refreshTimeThread.start();
	}

}
